The invention relates broadly to the field of digital computers and particularly to a barrel shifter which is utilized as part of a computer in various operations.
Shifting operations are frequently used in the performance of computation in digital computers. Most large digital computers, often called main frames, have very elaborate shift circuits to perform the desired shifting operations at high speed. These circuits usually require a large number of gates especially if the shifter is capable of shifting data by a selectable number of bit positions. Accordingly, the shifters found in main frame computers are complex in design, high in circuit count and, therefore, are costly.
In smaller and less expensive computers, the shifting operation is usually done in a simple one bit at a time shifter and the operation is repeated as many times as is necessary to complete the desired shift amount. Obviously, the hardware cost of such a shifter is low but the performance suffers greatly as the speed of the operation depends directly on the number of one bit shifts performed.
Multi-level shift circuits are known, the circuit illustrated in U.S. Pat. No. 3,274,556 being typical. This patent illustrates a 64 bit shifter which can perform logical shifts and rotates in either direction. In addition, the circuit has only three levels of gates. The first level shifts 0, 16, 32 or 48 bits in either direction. The second level shifts 0, 4, 8, 12 bits to the right and the third level shifts 0, 1, 2, 3 bits to the right. This circuit, as is illustrated by the 23 sheets of drawings, is quite complex and hence expensive to implement.
Other complex shifter circuits are illustrated in U.S. Pat. Nos. 3,374,468, 3,239,764, 3,610,903, 3,350,692, 3,311,896, 3,510,846, 3,192,363, 3,374,463, 3,210,737, 3,582,899 and 3,229,080. All of these circuits have varying degrees of complexity and differences in functionality.
A newer design of a barrel shifter utilizing an SN74AS897 circuit is illustrated in an article in the Jan. 12, 1984 issue of Electronic Design starting at page 385. The AS897 is a multi-function 16 bit shifter. As illustrated in FIG. 2 of the article, however, four of the chips are required to perform the same operation on a 32 bit word. Thus, the AS897 is expensive to use in 32 bit applications and it is not altogether clear if it could be used in 64 bit applications.
In view of the above mentioned problems with barrel shifters and the generally desirable features of such devices, it is a primary objective to provide a barrel shifter which operates at high speed but which is not expensive either in circuit cost or in utilizing excessive circuit board space.
It is a further objective to provide a barrel shifter having the above mentioned desirable features but also being capable of working on data with variable format and to be able to perform arithmetic shift operations.
It is yet another object of the invention to provide a barrel shifter which is readily cascadable to operate on larger word sizes without inordinately increasing the circuit count.